{include file='../Public/header.html'}
{literal}
<script>
	//定义页面载入事件
	$(function(){
		//获取btnAdd按钮
		$('#btnAdd').bind('click',function(){
			// 添加分类的链接
			window.location.href = 'index.php?p=Back&c=Category&a=add';
		});
	});
</script>
{/literal}
<div class="admin">
	<form method="post" action="index.php?p=Back&c=Category&a=delAll">
    <div class="panel admin-panel">
    	<div class="panel-head"><strong>分类列表</strong></div>
        <div class="padding border-bottom">
            <input type="button" class="button button-small checkall" name="checkall" checkfor="cate_id[]" value="全选" />
            <input type="button" id="btnAdd" class="button button-small border-green" value="添加分类" />
            <input type="submit" class="button button-small border-yellow" onclick="return confirm('确定要批量删除吗?')"; value="批量删除" />
            <input type="button" class="button button-small border-blue" value="回收站" />
        </div>
        <table class="table table-hover">
		     <tr>
                <th width="45">选择</th>
                <th width="120">所属类别</th>
                <th width="240">分类名称</th>
                <th width="*">分类描述</th>
                <th width="100">操作</th>
            </tr>
            {foreach from=$cateInfo item='row'}
           
            <tr>
                <td><input type="checkbox" name="cate_id[]" value="{$row.cate_id}" /></td>
                <td>{$row.cate_pid}</td>
                <td>{$row.cate_name|indent:{$row.level*5}:'-'}</td>
                <td>{$row.cate_desc|truncate:15}</td>
                <td>
                    <a class="button border-blue button-little" href="index.php?p=Back&c=Category&a=edit&cate_id={$row.cate_id}">修改</a> 
                    <a class="button border-yellow button-little" href="index.php?p=Back&c=Category&a=del&cate_id={$row.cate_id}" onclick="return confirm('确定要删除吗?')";>删除</a>
                </td> 
            </tr>
            {/foreach}
        </table>
    </div>
    </form>
    <br />
    <p class="text-right text-gray">基于<a class="text-gray" target="_blank" href="#">MVC框架</a>构建</p>
</div>
</body>
</html>